import java.util.LinkedList;

/*
 * @lc app=leetcode.cn id=9 lang=java
 *
 * [9] 回文数
 */

// @lc code=start
class Solution {
    public boolean isPalindrome(int x) {
        if(x<0)
            return false;
        LinkedList<Integer> data=new LinkedList<>();
        LinkedList<Integer> data1=new LinkedList<>();
        while(x>0){
            data.add(x%10);            
            data1.addFirst(x%10);
            x/=10;
        }
        for (Integer integer : data) {
            if(data1.pollFirst()!=integer)
                return false;
        }
        return true;
        
    }
}
// @lc code=end

